public class seleceSort {


    public static void selsort(int[] elem){
        for (int i = 0; i < elem.length; i++) {
            int tem = i;
            for (int j = i + 1; j < elem.length; j++) {
                if (elem[j] < elem[tem]){
                    tem = j;
                }
            }
            swap(elem,i,tem);
        }
    }
    //进行数据的位置交换
    private static void swap(int[] array,int i,int j){
        int cur = array[i];
        array[i] = array[j];
        array[j] = cur;
    }
}
